.class Lcom/waiqin365/h5/customer/d;
.super Ljava/lang/Object;

# interfaces
.implements Ljava/lang/Runnable;


# instance fields
.field final synthetic a:Lcom/waiqin365/h5/customer/WqCustomerTypePicker;


# direct methods
.method constructor <init>(Lcom/waiqin365/h5/customer/WqCustomerTypePicker;)V
    .locals 0

    iput-object p1, p0, Lcom/waiqin365/h5/customer/d;->a:Lcom/waiqin365/h5/customer/WqCustomerTypePicker;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 3

    const/4 v2, 0x0

    invoke-static {}, Lcom/waiqin365/lightapp/view/a/b;->a()Ljava/util/Observable;

    move-result-object v0

    iget-object v1, p0, Lcom/waiqin365/h5/customer/d;->a:Lcom/waiqin365/h5/customer/WqCustomerTypePicker;

    invoke-virtual {v0, v1}, Ljava/util/Observable;->addObserver(Ljava/util/Observer;)V

    iget-object v0, p0, Lcom/waiqin365/h5/customer/d;->a:Lcom/waiqin365/h5/customer/WqCustomerTypePicker;

    new-instance v1, Lcom/waiqin365/base/db/cmfilteritem/a;

    invoke-direct {v1}, Lcom/waiqin365/base/db/cmfilteritem/a;-><init>()V

    invoke-static {v0, v1}, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->a(Lcom/waiqin365/h5/customer/WqCustomerTypePicker;Lcom/waiqin365/base/db/cmfilteritem/a;)Lcom/waiqin365/base/db/cmfilteritem/a;

    iget-object v0, p0, Lcom/waiqin365/h5/customer/d;->a:Lcom/waiqin365/h5/customer/WqCustomerTypePicker;

    invoke-static {v0}, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->a(Lcom/waiqin365/h5/customer/WqCustomerTypePicker;)Lorg/apache/cordova/CordovaArgs;

    move-result-object v0

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/waiqin365/h5/customer/d;->a:Lcom/waiqin365/h5/customer/WqCustomerTypePicker;

    invoke-static {v0}, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->a(Lcom/waiqin365/h5/customer/WqCustomerTypePicker;)Lorg/apache/cordova/CordovaArgs;

    move-result-object v0

    invoke-virtual {v0, v2}, Lorg/apache/cordova/CordovaArgs;->isNull(I)Z

    move-result v0

    if-nez v0, :cond_1

    :try_start_0
    iget-object v0, p0, Lcom/waiqin365/h5/customer/d;->a:Lcom/waiqin365/h5/customer/WqCustomerTypePicker;

    invoke-static {v0}, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->a(Lcom/waiqin365/h5/customer/WqCustomerTypePicker;)Lorg/apache/cordova/CordovaArgs;

    move-result-object v0

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lorg/apache/cordova/CordovaArgs;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_1

    move-result v1

    if-nez v1, :cond_1

    :try_start_1
    new-instance v1, Lorg/json/JSONObject;

    invoke-direct {v1, v0}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    const-string/jumbo v0, "id"

    invoke-virtual {v1, v0}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/waiqin365/h5/customer/d;->a:Lcom/waiqin365/h5/customer/WqCustomerTypePicker;

    invoke-static {v0}, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->b(Lcom/waiqin365/h5/customer/WqCustomerTypePicker;)Lcom/waiqin365/base/db/cmfilteritem/a;

    move-result-object v0

    const-string/jumbo v2, "id"

    invoke-virtual {v1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/waiqin365/base/db/cmfilteritem/a;->a(Ljava/lang/String;)V

    :cond_0
    const-string/jumbo v0, "name"

    invoke-virtual {v1, v0}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/waiqin365/h5/customer/d;->a:Lcom/waiqin365/h5/customer/WqCustomerTypePicker;

    invoke-static {v0}, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->b(Lcom/waiqin365/h5/customer/WqCustomerTypePicker;)Lcom/waiqin365/base/db/cmfilteritem/a;

    move-result-object v0

    const-string/jumbo v2, "name"

    invoke-virtual {v1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/waiqin365/base/db/cmfilteritem/a;->b(Ljava/lang/String;)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
    .catch Lorg/json/JSONException; {:try_start_1 .. :try_end_1} :catch_1

    :cond_1
    :goto_0
    iget-object v0, p0, Lcom/waiqin365/h5/customer/d;->a:Lcom/waiqin365/h5/customer/WqCustomerTypePicker;

    iget-object v1, p0, Lcom/waiqin365/h5/customer/d;->a:Lcom/waiqin365/h5/customer/WqCustomerTypePicker;

    invoke-static {v1}, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->c(Lcom/waiqin365/h5/customer/WqCustomerTypePicker;)Lorg/apache/cordova/WqCordovaActivity;

    move-result-object v1

    invoke-static {v1}, Lcom/waiqin365/base/db/offlinedata/d;->a(Landroid/content/Context;)Lcom/waiqin365/base/db/offlinedata/d;

    move-result-object v1

    invoke-virtual {v1}, Lcom/waiqin365/base/db/offlinedata/d;->c()Ljava/util/ArrayList;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->a(Lcom/waiqin365/h5/customer/WqCustomerTypePicker;Ljava/util/ArrayList;)Ljava/util/ArrayList;

    iget-object v0, p0, Lcom/waiqin365/h5/customer/d;->a:Lcom/waiqin365/h5/customer/WqCustomerTypePicker;

    invoke-static {v0}, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->b(Lcom/waiqin365/h5/customer/WqCustomerTypePicker;)Lcom/waiqin365/base/db/cmfilteritem/a;

    move-result-object v0

    if-nez v0, :cond_2

    iget-object v0, p0, Lcom/waiqin365/h5/customer/d;->a:Lcom/waiqin365/h5/customer/WqCustomerTypePicker;

    new-instance v1, Lcom/waiqin365/base/db/cmfilteritem/a;

    invoke-direct {v1}, Lcom/waiqin365/base/db/cmfilteritem/a;-><init>()V

    invoke-static {v0, v1}, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->a(Lcom/waiqin365/h5/customer/WqCustomerTypePicker;Lcom/waiqin365/base/db/cmfilteritem/a;)Lcom/waiqin365/base/db/cmfilteritem/a;

    :cond_2
    new-instance v0, Landroid/content/Intent;

    iget-object v1, p0, Lcom/waiqin365/h5/customer/d;->a:Lcom/waiqin365/h5/customer/WqCustomerTypePicker;

    invoke-static {v1}, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->c(Lcom/waiqin365/h5/customer/WqCustomerTypePicker;)Lorg/apache/cordova/WqCordovaActivity;

    move-result-object v1

    const-class v2, Lcom/waiqin365/lightapp/kehu/CMCustomerTypeSelectActivity;

    invoke-direct {v0, v1, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    const-string/jumbo v1, "filteritems"

    iget-object v2, p0, Lcom/waiqin365/h5/customer/d;->a:Lcom/waiqin365/h5/customer/WqCustomerTypePicker;

    invoke-static {v2}, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->d(Lcom/waiqin365/h5/customer/WqCustomerTypePicker;)Ljava/util/ArrayList;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/io/Serializable;)Landroid/content/Intent;

    const-string/jumbo v1, "cmFilterItem"

    iget-object v2, p0, Lcom/waiqin365/h5/customer/d;->a:Lcom/waiqin365/h5/customer/WqCustomerTypePicker;

    invoke-static {v2}, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->b(Lcom/waiqin365/h5/customer/WqCustomerTypePicker;)Lcom/waiqin365/base/db/cmfilteritem/a;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/io/Serializable;)Landroid/content/Intent;

    const-string/jumbo v1, "returnTo"

    iget-object v2, p0, Lcom/waiqin365/h5/customer/d;->a:Lcom/waiqin365/h5/customer/WqCustomerTypePicker;

    iget-object v2, v2, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->a:Ljava/lang/String;

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    iget-object v1, p0, Lcom/waiqin365/h5/customer/d;->a:Lcom/waiqin365/h5/customer/WqCustomerTypePicker;

    invoke-static {v1}, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->c(Lcom/waiqin365/h5/customer/WqCustomerTypePicker;)Lorg/apache/cordova/WqCordovaActivity;

    move-result-object v1

    invoke-virtual {v1, v0}, Lorg/apache/cordova/WqCordovaActivity;->startActivity(Landroid/content/Intent;)V

    iget-object v0, p0, Lcom/waiqin365/h5/customer/d;->a:Lcom/waiqin365/h5/customer/WqCustomerTypePicker;

    invoke-static {v0}, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->c(Lcom/waiqin365/h5/customer/WqCustomerTypePicker;)Lorg/apache/cordova/WqCordovaActivity;

    move-result-object v0

    const v1, 0x7f040022

    const v2, 0x7f040021

    invoke-virtual {v0, v1, v2}, Landroid/app/Activity;->overridePendingTransition(II)V

    return-void

    :catch_0
    move-exception v0

    :try_start_2
    iget-object v0, p0, Lcom/waiqin365/h5/customer/d;->a:Lcom/waiqin365/h5/customer/WqCustomerTypePicker;

    new-instance v1, Lcom/waiqin365/base/db/cmfilteritem/a;

    invoke-direct {v1}, Lcom/waiqin365/base/db/cmfilteritem/a;-><init>()V

    invoke-static {v0, v1}, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->a(Lcom/waiqin365/h5/customer/WqCustomerTypePicker;Lcom/waiqin365/base/db/cmfilteritem/a;)Lcom/waiqin365/base/db/cmfilteritem/a;
    :try_end_2
    .catch Lorg/json/JSONException; {:try_start_2 .. :try_end_2} :catch_1

    goto :goto_0

    :catch_1
    move-exception v0

    invoke-virtual {v0}, Lorg/json/JSONException;->printStackTrace()V

    goto :goto_0
.end method
